@menu-prefix: ~"@{prefix}menu";
.@{menu-prefix} {
  width: 100%;
  display: block;
  margin: 0;
  padding: 0;
  outline: none;
  list-style: none;
  position: relative;
  line-height: 1;
  &-ul {
    .h-func-list-style();
  }
  &-li{
    position: relative;
  }
  &-show {
    position: relative;
    padding: 15px 26px;
    cursor: pointer;
    text-overflow: clip;
    white-space: nowrap;
    transition: padding .2s;
    &-expand {
      right: 20px;
      .middle();
    }
    &-desc {
      transition: opacity .3s cubic-bezier(.645, .045, .355, 1),width .3s cubic-bezier(.645, .045, .355, 1);
      opacity: 1;
    }
    &-count{
      transition: right .2s;
      z-index: 2;
      right: 60px;
      .middle();
    }
  }
  & &-li a {
    display: block;
    color: inherit;
    font-weight: inherit;
    text-decoration: inherit;
  }
}

.h-menu-mode-normal {
  .h-menu-ul {
    max-height: 0;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    overflow: hidden;
  }
  .h-menu-li .h-menu-li {
    .h-menu-show {
      padding-left: 50px;
    }
    .h-menu-li .h-menu-show {
      padding-left: 70px;
    }
  }
  .h-menu-li-opened > .h-menu-ul {
    max-height: 1000px;
    transition: max-height 0.8s ease-in-out;
  }
  .h-menu-li-opened > .h-menu-show .h-menu-show-expand>i{
    transform: rotate(0deg);
  }
  .h-menu-show {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color @transition-time;
    &-icon{
      margin-right: 5px;
    }
    &-expand {
      >i{
        transition: transform @transition-time;
        transform: rotate(-90deg);
      }
    }
  }
}

.@{menu-prefix}-dark {
  background: @menu-dark-color;
  color: darken(@white-color, 30%);
  .@{menu-prefix} {
    &-show {
      border-right: 0px solid transparent;
      &:hover {
        color: @white-color;
      }
    }
    &-ul {
      background: darken(@menu-dark-color, 5%);
    }
    &-li {
      &-selected {
        background: @primary-color;
        color: @white-color;
      }
    }
  }
}

.@{menu-prefix}-white {
  background: @white-color;
  .@{menu-prefix} {
    &-show {
      &:hover {
        color: @primary-color;
      }
    }
    &-ul {
      background: @white-color;
    }
    &-li {
      position: relative;
      .@{menu-prefix}{
        &-show{
          &:after {
            position: absolute;
            content: '';
            top: 0;
            right: 0;
            bottom: 0;
            width: 0px;
            background: @primary-color;
          }
        }
        &-li-selected{
          background-color: @menu-white-background-color;
          color: @primary-color;
          &:after {
            width: 5px;
            transition: @transition-time;
          }
        }
      }
    }
  }
}


.@{menu-prefix} {
  &&-size-collapse {
    > .h-menu-li {
      > .h-menu-show {
        padding-left: 28px;
        .h-menu-show-icon{
          margin-right: 0px;
          font-size: 17px;
        }
        .h-menu-show-desc {
          visibility: visible;
          opacity: 0;
          // position: absolute;
          display: inline-block;
          width: 0;
          text-overflow: clip;
        }
        .h-menu-show-count{
          right: 10px;
        }
        .h-menu-show-expand{
          display: none;
        }
      }
    }
    .h-menu-ul{
      padding: 5px 0;
      margin-left: 5px;
      // display: none;
      left: 100%;
      top: 0;
      width: 150px;
      border-radius: 4px;
      overflow: hidden;
      // visibility: hidden;
      position: absolute;
      max-width: 0;
      // overflow: visible;
      transition: 0.2s cubic-bezier(0.78, 0.17, 0.43, 1);
      white-space: nowrap;
      display: inline-block;
      overflow: hidden;
      opacity: 0.8;
      transform: scale(0.8);
      transform-origin: left;
      .h-menu-show{
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
    .h-menu-show-expand {
      right: 10px;
      i{
        transform: rotate(-90deg);
      }
    }
    .h-menu-li:hover {
      > .h-menu-ul {
        // padding: 5px 0;
        max-width: 250%;
        opacity: 1;
        // visibility: visible;
        transform: scale(1);
        // display: block;
        overflow: visible;
        &:before{
          content: '';
          position: absolute;
          height: 100%;
          top: 0;
          left: -10px;
          width: 10px;
        }
      }
    }
    .h-menu-show {
      padding-left: 20px;
    }
  }
}
.@{menu-prefix}-mode-horizontal{
  &:after {
    content:""; 
    display:table; 
    clear:both;
  }
  .h-menu-li {
    display: inline-block;
    .h-menu-show.h-menu-li-selected {
      background-color: @menu-white-background-color;
      color: @primary-color;
      // border-bottom: 2px solid @primary-color;
      &:after {
        content: '';
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: @primary-color;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
      }
    }
  }
  .h-menu-ul{
    padding: 5px 0;
    left: 0;
    top: 100%;
    width: 150px;
    opacity: 0.8;
    max-height: 0;
    margin-top: 5px;
    border-radius: 4px;
    // transition: max-height 0.2s ease-out;
    transition: 0.1s cubic-bezier(0.78, 0.17, 0.43, 1);
    transform-origin: top;
    opacity: 0.8;
    transform: scale(0.8);
    visibility: hidden;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    display: inline-block;
    .h-menu-li {
      display: block;
      .h-menu-ul {
        padding: 5px 0;
        left: 100%;
        margin-left: 5px;
        opacity: 0.8;
        top: 0;
        width: 150px;
        border-radius: 4px;
        // overflow: hidden;
        visibility: hidden;
        // overflow: hidden;
        position: absolute;
        max-height: 0;
        // transition: max-height 0.2s ease-out;
        transition: 0.1s cubic-bezier(0.78, 0.17, 0.43, 1);
        transform-origin: top;
        opacity: 0.8;
        transform: scale(0.8);
        white-space: nowrap;
        display: inline-block;
      }
    }
    .h-menu-show {
      overflow: hidden;
      text-overflow: ellipsis;
      transition: color @transition-time;
      &-icon{
        margin-right: 5px;
      }
      &-expand {
        >i{
          transition: transform @transition-time;
          transform: rotate(-90deg);
        }
      }
      &.h-menu-li-selected {
        background-color: @menu-white-background-color;
        color: @primary-color;
        &:after {
          content: '';
          position: absolute;
          width: 100%;
          height: 2px;
          background-color: @primary-color;
          bottom: 0;
          left: 0;
          right: 0;
          top: auto;
        }
      }
    }
  }
  .h-menu-show-expand {
    right: 10px;
    i{
      transform: rotate(-90deg);
    }
  }
  .h-menu-li:hover {
    > .h-menu-ul {
      // padding: 5px 0;
      // max-width: 250%;
      max-height: 10000px;
      // transition: max-height 0.2s ease-in;
      // height: 250%;opacity: 0.8;
      transform: scale(1);
      opacity: 1;
      visibility: visible;
      overflow: visible;
      // transform: scale(1);
      // display: block;
      // overflow: visible;
      &:before{
        content: '';
        position: absolute;
        width: 100%;
        top: -10px;
        left: 0;
        height: 10px;
      }
      &:after{
        content: '';
        position: absolute;
        height: 100%;
        top: 0;
        left: -10px;
        width: 10px;
      }
    }
  }

}
.@{menu-prefix}-mode-horizontal.@{menu-prefix}-dark {
  .h-menu-li {
    .h-menu-show {
      &.h-menu-li-selected {
        background-color: @primary-color;
        color: #ffffff;
        // border-bottom: 2px solid @primary-color;
        &:after {
          display: none;
        }
      }
    }
  }
}
